function import_excel_to_json(file, option) {
  var setCellRange = function (wbData, option) {
    var startCell = option.startCell;
    var cellRange = wbData['!ref'];
    var array = cellRange.split(':');
    if (startCell === undefined) {
      startCell = array[0];
    }

    var endCell = option.endCell;
    if (endCell === undefined) {
      endCell = array[1];
    }
    wbData['!ref'] = `${startCell}:${endCell}`;
  };

  var formatData = function (objData, option) {
    var fieldObj = option.formatOption;
    if (fieldObj === undefined) {
      return objData;
    }

    var dataList = [];
    for (var i = 0; i < objData.length; i++) {
      var obj = objData[i];
      data = {};
      for (const key in fieldObj) {
        var field = fieldObj[key];
        var value = obj[key];
        if (SysUtil.isEmpty(value)) {
          value = '';
        }
        data[field] = value;
      }
      dataList.push(data);
    }
    return dataList;
  };

  return new Promise(function (resole, reject) {
    var reader = new FileReader();
    reader.onload = function (e) {
      var data = e.target.result;
      wb = XLSX.read(data, {
        type: 'binary'
      });
      var seltext = wb.SheetNames[0];
      var sheetData = wb.Sheets[seltext];

      setCellRange(sheetData, option);

      var objData = XLSX.utils.sheet_to_json(wb.Sheets[seltext]);
      objData = formatData(objData, option);
      resole(objData);
    };
    reader.onerror = function (e) {
      reject(e);
    };
    reader.readAsBinaryString(file);
  });
}
